<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
		<script>
			var stringTime = "2014-07-10 10:21:12";
			var timestamp2 = Date.parse(new Date(stringTime));
			timestamp2 = timestamp2 / 1000;
			console.log(stringTime + "的时间戳为：" + timestamp2);
			function formatDate(now) { 
				var year=now.getYear(); 
				var month=now.getMonth()+1; 
				var date=now.getDate(); 
				var hour=now.getHours(); 
				var minute=now.getMinutes(); 
				var second=now.getSeconds(); 
				/*return "20"+year+"年"+month+"月"+date+"日 "+hour+":"+minute+":"+second; */
				return "20"+year+"年"+month+"月"+date+"日 "; 
			} 
			var d=new Date(1230999938); 
			alert(formatDate(d));
		</script>
	</body>
</html>
